import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_res_target_entity.dart';

EmergencyResTargetEntity $EmergencyResTargetEntityFromJson(Map<String, dynamic> json) {
  final EmergencyResTargetEntity emergencyResTargetEntity = EmergencyResTargetEntity();
  final String? attachmentAddress = jsonConvert.convert<String>(json['attachmentAddress']);
  if (attachmentAddress != null) {
    emergencyResTargetEntity.attachmentAddress = attachmentAddress;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyResTargetEntity.companyCode = companyCode;
  }
  final String? contactInformation = jsonConvert.convert<String>(json['contactInformation']);
  if (contactInformation != null) {
    emergencyResTargetEntity.contactInformation = contactInformation;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyResTargetEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyResTargetEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyResTargetEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyResTargetEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyResTargetEntity.id = id;
  }
  final String? importanceLevel = jsonConvert.convert<String>(json['importanceLevel']);
  if (importanceLevel != null) {
    emergencyResTargetEntity.importanceLevel = importanceLevel;
  }
  final String? importanceLevelName = jsonConvert.convert<String>(json['importanceLevelName']);
  if (importanceLevelName != null) {
    emergencyResTargetEntity.importanceLevelName = importanceLevelName;
  }
  final String? placeAddress = jsonConvert.convert<String>(json['placeAddress']);
  if (placeAddress != null) {
    emergencyResTargetEntity.placeAddress = placeAddress;
  }
  final String? responsiblePerson = jsonConvert.convert<String>(json['responsiblePerson']);
  if (responsiblePerson != null) {
    emergencyResTargetEntity.responsiblePerson = responsiblePerson;
  }
  final String? safetyMeasures = jsonConvert.convert<String>(json['safetyMeasures']);
  if (safetyMeasures != null) {
    emergencyResTargetEntity.safetyMeasures = safetyMeasures;
  }
  final String? sensitiveTargetName = jsonConvert.convert<String>(json['sensitiveTargetName']);
  if (sensitiveTargetName != null) {
    emergencyResTargetEntity.sensitiveTargetName = sensitiveTargetName;
  }
  final String? sensitiveTargetPhotos = jsonConvert.convert<String>(json['sensitiveTargetPhotos']);
  if (sensitiveTargetPhotos != null) {
    emergencyResTargetEntity.sensitiveTargetPhotos = sensitiveTargetPhotos;
  }
  final String? targetType = jsonConvert.convert<String>(json['targetType']);
  if (targetType != null) {
    emergencyResTargetEntity.targetType = targetType;
  }
  final String? targetTypeName = jsonConvert.convert<String>(json['targetTypeName']);
  if (targetTypeName != null) {
    emergencyResTargetEntity.targetTypeName = targetTypeName;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyResTargetEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyResTargetEntity.updateById = updateById;
  }
  final String? estimateName = jsonConvert.convert<String>(json['estimateName']);
  if (estimateName != null) {
    emergencyResTargetEntity.estimateName = estimateName;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyResTargetEntity.updateDate = updateDate;
  }
  return emergencyResTargetEntity;
}

Map<String, dynamic> $EmergencyResTargetEntityToJson(EmergencyResTargetEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachmentAddress'] = entity.attachmentAddress;
  data['companyCode'] = entity.companyCode;
  data['contactInformation'] = entity.contactInformation;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['importanceLevel'] = entity.importanceLevel;
  data['importanceLevelName'] = entity.importanceLevelName;
  data['placeAddress'] = entity.placeAddress;
  data['responsiblePerson'] = entity.responsiblePerson;
  data['safetyMeasures'] = entity.safetyMeasures;
  data['sensitiveTargetName'] = entity.sensitiveTargetName;
  data['sensitiveTargetPhotos'] = entity.sensitiveTargetPhotos;
  data['targetType'] = entity.targetType;
  data['targetTypeName'] = entity.targetTypeName;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['estimateName'] = entity.estimateName;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EmergencyResTargetEntityExtension on EmergencyResTargetEntity {
  EmergencyResTargetEntity copyWith({
    String? attachmentAddress,
    String? companyCode,
    String? contactInformation,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? importanceLevel,
    String? importanceLevelName,
    String? placeAddress,
    String? responsiblePerson,
    String? safetyMeasures,
    String? sensitiveTargetName,
    String? sensitiveTargetPhotos,
    String? targetType,
    String? targetTypeName,
    String? updateBy,
    String? updateById,
    String? estimateName,
    String? updateDate,
  }) {
    return EmergencyResTargetEntity()
      ..attachmentAddress = attachmentAddress ?? this.attachmentAddress
      ..companyCode = companyCode ?? this.companyCode
      ..contactInformation = contactInformation ?? this.contactInformation
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..importanceLevel = importanceLevel ?? this.importanceLevel
      ..importanceLevelName = importanceLevelName ?? this.importanceLevelName
      ..placeAddress = placeAddress ?? this.placeAddress
      ..responsiblePerson = responsiblePerson ?? this.responsiblePerson
      ..safetyMeasures = safetyMeasures ?? this.safetyMeasures
      ..sensitiveTargetName = sensitiveTargetName ?? this.sensitiveTargetName
      ..sensitiveTargetPhotos = sensitiveTargetPhotos ?? this.sensitiveTargetPhotos
      ..targetType = targetType ?? this.targetType
      ..targetTypeName = targetTypeName ?? this.targetTypeName
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..estimateName = estimateName ?? this.estimateName
      ..updateDate = updateDate ?? this.updateDate;
  }
}
